started working on MLB version of algorithm