Added Shelan's new code