Revamped captures() with new logic and condensed code