Added relock function
Changed the lock function to return the lock ID instead of the unlock function