minor: added some documentation while reading the code
Java backend: added comments/questions while reading code; minor refactorings