Implemented Exercises 1-4