Code created while reading through http://www.nodebeginner.org/