Write an algorithm for implementing a Process Control Block