Updated existing code to fit other project.