Added priorities, which appears to have fixed CPU queue bug. Also changed logic of ReleaseCPU to reflect diagram.