My implementation of learnyounode's tasks