Geometric WOM codes and coding strategies for multilevel flash memories