Updated format and added button logic

Created comment lines to separate functions for clarity
Added logic to on_removeSecondary_clicked() for by Category