Working version with standard redirections