modified for linux system