Added a preview mode, fixed / found a couple more bugs