Implementation with ArrayList