new solution from wota
indent and warning about strchrnul