ammended java snippets