Solution working, just need to think it through now