moved external code snippet into the project