I love the usage of `min` and `max` functions do this :) I would've used if-else statements.