bugs fixed, for the most part