Rewrote whole program :D