using bkr code. has warnings, also think there's a prob with definitions in main
rewrote makefile. has warnings