Program done. Testing on mac now