The instructions you seek are in the project.
Me for most of it. Big thanks to @154667 for the "Average of 2 numbers" scripts. Without his scripts, this project would've been terrible.