tidying up Makefile
deleted arralloc files
offloaded memory cleanup to local helper function (code repetition)