Updated to use Tcl allocation routines for memory allocating/releasing