changed size; better reduction func