first version

the original code