refactored final_shadow to use a different data structure and cut out some extra data manipulation