Working levelgeneration from segments. For more details check README