added code for Uva:294