Advanced version from Threads1. Now the transaction gets on hold when account doesn't have enough money. Used wait() and notifyAll() to handle those cases.