heading working -lm needs to be added to linker for math.h