Lots of changes to make this suck a lot less