Grabbed some changes from windows