-added comments -improved const correctness