version 1.3 taken from sourceforge