Added collision dectection for the left and the right.