first working version. Added to crontab