made a few changes and did error checking, I think i handled all cases
Merge pull request #20 from kraftery/bori

made a few changes and did error checking, I think i handled all cases