Used array instead of arraylist