adding Thread.sleep for better visualisation while executing