renamed algorithms class and refactored main class