Major revamp. Code should be alot cleaner now