java code for hatching some ideas