finished first working version of security manager