removed redundant code - untested