some destructor code and optimisation stuff

added support for destructor code and updated Makefile