fixed outstanding issues and minor corrections