Changed the code to accept comments and if