calculate compensation