start of convert challenge
fix for exercise 6, convert.
trying challenge 3 - got it to work, though not sure how elegant this is