Removed some duplication
Made run recursive