refactored tests
fixed merge bugs