first version, converting working