added constructor with arraylist