(re)added some features, some refactoring errors have been eliminated but still needs work
many changes, primarily refactoring warning: won't work yet