trying the same in java since three days with a lot of fun