cleaned up and added compareTS()