Redo some of the functions