fixed a bunch of stuff but not quite done