Implemented Lamports Algorithm