Corrected most of the bugs to adjust for tides.