implement netlock psuedo code