Had to change function order around