added code to handle the different platforms that this could be run on