integrated Matts API and implemented pitch logic