method pointer as an equivalent solution added