Fixed last line search taking too much time by adding an epsilon for equality checking