readme and some minor code cleanup