Reeeeeeeedooooooooo

Wiped a lot of code, but re-implimented most of it so it's alright by me.

Signed-off-by: saforer <saforer@gmail.com>