A bunch of changes to get it to actually work (kinda).