updated function names and frontend.R