Improve show completed and uncompleted with a more efficient algorithm