Changed to a faster algorithm for life.