added source code of first version