adding schedule function (needs debugged)
adding schedule function (needs debugged)