switching to ListBuffer to improve performance