Added optimization that improved performance greatly.
Merge branch 'master' of https://github.com/scobb/AlgoPA3