initial version

based on code by www.github.com/tru