Added collision function to script