refactored command generation and tracking
renamed main file