Rewrite

Did a rewrite of some stuff to make it run better, still buggy as fk
though..