project update: forming portions of the code into callable functions for later use