hacking around to make it portable