Updated Solution