redoing jmat.googlecode.com