Final cont rab. commit

Also some code I forgot to commit from the last one slipped in