working on input structure: now it works partially