fixes #16 (naive implementation