fixed a huge number of kludges, broke lagCompensate, greatly improved the appearance of the code