Added ball logic.