changed whereclause, removed variable declaration, added default values to index