added comments and security