fix speed bugs
Merge pull request #37 from nwhcairns/master

fix speed bugs