Added switch statement for collision flags