first version with full functional