this is my attempt at Programming Assignment 2