String Function revised and now works with the console log