swapped out legacy code for new stuff