added types for returned values
multiple accumulators for differently grated returns