first version with old code. To update