Done a little hacky but have a final working version...working well enough