fixed all bugs, changed make file for macs