updated to handle an unknown amount of numbers seperated by commas