final solution after phase3