Fixed out of range error
Basic exponential decay implementation