Modified to better fit assignment requirements