Updated Lock Protocol and tidied Arduino code