added enumerate, variables clearer