solution of challenge 10 of "learnyounode"