Algorithm-1 class work