updates and minor code changes