removing redundant variables