updated with problem statement