implementing assigment 1