geo.c not working but now it has all the logic required