Refactored lamport.c.