first attempt at problem one