function is converted to method