Comments and some code cleanup