reduce lines of code required to gather variables

thanks to @conkiztador for another lesson :)