Added portablility using preprocessor