Sort:  

Thanks! Most of the valuable inputs came from sds.steemworld.org, and the source code for @trufflepig