Implemented a bunch of stuff