replace LinkedList with ArrayList and replace StringBuffer with
StringBuilder