draft of correct solution