added comments, locks