added start_pos and end_pos to generator.py