added tomcat and a code tidying