edited solution