Previous commit had removed chunks of code - restored