Making stuff const and adding some comments.
Merge branch 'sdev' into develop