add an alloc method that allows defining min size