fixed algorthim
Merge pull request #171 from kmabey/LocalDev

fixed algorthim