small changes to remove warnings and add comments
change StringBuffer to StringBuilder and got rid of the plus signs in favor of append