Function allAreDone implemented