Updated comments and made slight code revisions