Adding in lahiff's improvements
AND fixing a tab.