final performance tuning and makefile edits