Commit 2

Code is not mine but taken from Code Academy Ruby course. Credits given
properly inside the source code as top comment.