Init
Imported from https://gist.github.com/fujimura/9682463