from https://github.com/razorlove-legacy/foocoin (with some issues like duplicate at least one sect and mac os x 10.9 not working