input handling first version