Added boolean parameter asynchronous to allow 
running it asynchronous for true and synchronous for false.