Updated to support mac and linux.