Changed CleanUpCourt in all functions