reading number of attirbutes and outputs dynamically