have basic functions. Just need to write output and clean up.