add logging stuff
refactoring the same
checkin lab 3