Updated according to assignment 3 requirements.