Changed according to homework instructions instead of lecture