SFegan's code working.