Made all_same a bit nicer (at bluemonkey's suggestion)