code changes and optimisation
code changes and optimisation