using List type instead of ArrayList