merged provided solution with parser into tinydb