solved prob189, storing rough draft before cleaning it up
added explanation to prob189