Added security functionality, completed