touch up on malloc functions