seems to be working now, just needs clean-up