Rolled in lock command (code from Luke).