refactor and comment optional solutions