lab5.s - before edge counter implementation