working update and minor bug fixes