added selecting areas and counting attributes