Fixed new algorithm (added decay)