added repl and cleanup