edited and completed ruby file exercise3