Modify original implementation to suit linux environment