fixing bugs
adding tests