revised for linux system