bug fix + added test files