Support Mac OS X!!!!!!!!!!

TODO: refactoring
Indent