working malloc and free  - need to get history next