added trim() then slice(0,-1) to remove extra returns and final delimiter before split()-ing