Added comments and flow to main