trying out Jython

fixed bug which assumed that set(list) would preserve order