Cleaned up code, commented, changed logging framework to log4j