Update

Rewrote codebase, fixed bugs.