Corrected translate function and added an if to verify operational system