Added Tom's code for comparison