Saving state, added dumb opt parser and fixed comments.