found some more bugs and fixed them