modify some java files | add calculate method