Added companion object code snippet to readme.