probably minor changes that I don't quite remember, still includes debug cout's