Credits To Shawn McCool For Some Code

Signed-off-by: David Thorpe <davzie@davzie.com>