Assignment 5 modigied