added two input and three input functions