added checkin and checkout functionality and test