changed command execution function to run instead of main