replaced int inside EDGE with uint8_t