Implemented lots of stuff. Too tired to explain. JS is awful. 'THIS'.