Tue Mar 5 16:44:39 EST 2013 geoff i took the opportunity to tidy the code somewhat.