modified main and linked functions to gui