added correct corner logic and handling of interrupt collisions