output is now done in a synchronous manner