First Working Implementation With Tolerance.

This implementation is working with tolerance number. If dont want to
use tolerance than pass tolerance 0.