modified to make it run in linux os that is multi-platform