cleaned up compensation code