more work on malloc and free