tests created and bug fixed