added tests
refactoring
minor edit fix
added tests