Accidentially removed code which is still needed.