lab5-correct.s - edge counter implemented