Updated for linux compatibility