minor fixes and cleanup. adding interactive mode