Made some code conditional on OS, available tools