init version; copied moved from https://gist.github.com/mbohun/af110bcd6e6178b7def3