Giving a better example and improving the "waiting" and "done" functions
implementation