modularizing code and recorded output