Implements startloop and endloop. Getting rid of crontab