updated code to work on PC.