use sizeof double to allocate means