implement addinput and other functions