Define method in user-def class and send the Array as argument to that function