linking gui to algorithm