Calculating some offsets. And getting this stuff to work on Linux.