recoding everything to support Linux and Mac