Updated to deal with more platforms