adding comments
fix a bug with checking for duplicates, cleaning up commenting,