Added comments and modularized the the files