HW4: Bug-fix and re-organization

Bug-fix and minor code re-reorganization.