quick fixes.  still need to fix memory usage.