More fiddling with compass code