removes whitespace and adds variables