updated code per Jamel's unit test work