fixed aacgm bug, added test routine