Code improvements -optimisation on animation lagging, autoscrolling