Updated readme and some code cleanup.