Ummm...is this homework???
It feels like it.
If not, what will it be used for? Can you convince us?
It would only take a few minutes to re-code it, so no charge if it's not homework.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.