corrected navigation - cleaned up code