added documentation, a BIND I forgot in a switch statement, and the array range function