commented and minor changes