Fixed the stupid doesn't work issues
Messed up commit history, but the code works!