make more flexible parsing of main list