changed read-in functionality, and changed hash sets to array lists