improved input handling wip