Reverted to a working version. Need to merge from previous one.