tidied up java