Changed to return strings rather than print them