some bugs fixed, test written, version() added