Transferred tax code to a function