Added check for running and fixed some bugs relating to the time. Also added the setting of variable minimum interval