First pass at implementing lock() and unlock()