add opening line, loop, and quit function.