Added first pass at refcount\n TODO: make makefile less stupid...