source code of version 1