work on schedule algorithm