rewrote most of it; added internationalization; commented code