function receiving variables and returning results.