Added std flag
Use malloc instead of alloca in the volume function