ARGH!... I'm getting close to having a working function... one last issue to address.