Clean-up and comments added