fixing a few things, still partially broken