added non-IP side, added several new methods for large-angle correction, code cleaning still to be done!