Added compass code