refactor code, clean up if-else
create while loop to execute replace_px
update readme