Completed code before assignment submission