bug fixes
Finaly good version.
Added GPL header
Added $id$ tag