updated to take into account the differences between windows and mac