removed some redundant variables