Simple implementation of malloc and free