Some style changes, small optimizations, PHP end tags omitted,Tabs to spaces, some other minor changes