Improve comments a little and add caching of the calculated values.