added support for 'thing' and made some minor stylistic changes