renamed a bunch of stuff and probably introduced bugs