using vector for logic