Added more comments. Worked on command line interface.