Issue: #22

  * Added minor fix to algo