implement io redirection
solve merge