Made string inputs pass by reference to increase memory efficiency