modified for programm assigment2