Add UI/Server code for shiny, More changes to helper function