clean up, added features to logging class, added mail class