upper function