implement input functions