beta. need to refactor code and fix bugs