updating testing cases and fixing bugs