okay, fixed this for now, still a little odd in places, but it works!