a bit of code from cs101 class that i've recently completed