add more source files and minor modifications