in the security class, added comments and made more OOP friendly