revisit and updated the solutions