added logic to determine valid category and amount in parsedAmount