Improved Beautiful Strings submission