set start and end of the way. throw ioexception, set position