updated (12/4/13) using pipes