parsing input - not tested