issue #1. slightly improved