Change array -> vector and add some test cases