reworking decay code