add multi key locking functionality

I adapted the functionality to be able to lock on more than one key at the same time.