various additional optimizations
include anonymousHN's solution; update Makefile