Reformatted text, fixed spelling errors and made all global variables static final.