platform detection working as it should

still very messy and hacky feeling