Completed programming for week3