rewrite for linux