Found a pretty large bug.

writeOut now works properly now. I also changed the name of the gps flag. before the flag overwrote the gps api, now it works properly.