Modified according to the requirements.