most input button logic finished