a simple function in scala