str splitting and substring for parsing, actually works, fixes #1