assign3:add implementation of some methods