code improvement to detect more platforms

Added methods to import into your projects. :-)