implemented main function, going to refactor more later