ph4390_bjmalec resubmitting assignment #4 with much better modularization