fix hemisphere code so that object order does not matter