committed latest changes. Please see comments for my suggestions/corrections