Changed normal mapping into function