modified to support Linux