added colors, fixed mem leaks, untested