Misc code while going through the book Programming In Scala