above seems messier than older code.