first attempt at problem 27