new approach, didn't get it to work in Java.hs