major refactoring, fixed models
added more algorithms