Advances in Ramsey theory and discrepancy theory