Made changes for better portability