removed redundant variable, minor changes