Algorithm improved by changing parameters