fixing bugs and adding tests