Added priority with time slice

will check if the result is correct or not