added compass code