first commit; contains code answers to first 4 questions