added platform-dependant codes