Added comments, annotation, minor clean-up.