add better pitch logic