added reflection logic (untested)