Edited code for backend and radio buttons