modified the code and integrated with Maven.