imported from http://syncless.googlecode.com/svn