Added comments and expanded program