fork of cjwizard with a few minor modifications