solutions up to challenge 9 of "learnyounode"