update to use ListBuffer, faster than Vector for append operations