Copied and pasted code worked out on PC.