This paper examines the steady state behaviour of an M/G/1 queue with a second optional service in which the server may provide two phases of heterogeneous service to incoming units. We derive the queue size distribution at stationary point of time and waiting time distribution. Moreover we derive the queue size distribution at the departure point of time as a classical generalization of the well known Pollaczek Khinchin formula. This is a generalization of the result obtained by Madan.