Tried merging helper functions into main file to get around errno 10061, didn't work