simple function in scala