Removed some of the function psuedo code