fixed tile altitude, cleaned up some more code.