use StringBuilder; add public domain headers; change input classes' package