changed vector to arraylist