refactored past checkin js