Implemented methods for assignemnt 2