written for various cs classes I've taken