Minor code changes; added comments on data structures