Major rewrite of SDD.