add javadoc and renamed send method to generate