Adjustable !time r, credit for the beginning of the code goes to iRetzKu