This is an updated PR of #615 -- based on discussion in #621 Fixes #621 Signed-off-by: Thomas Jackson <jacksontj.89@gmail.com>