fixing and movintg the functions around