first version with vector