finished writing most of the security implementation plus a few small changes.