add erasure to makefile, fix bugs