final project work. integrated new count functions and fill rec. Still need to apply to an actual case