added option to set decay rate