I've kinda got this working, need to replace nulls