added average precision calculation. Fixed comments in javadoc.