commented, minor bug fixes