Delay rate calc
Code cleanup