Hearts 3 Dundee United 2: Tangerines finish difficult year with defeat