add main, update readme, refactor