implemented anant's suggestion