partially working; needs to work on maintaining the freelist