fixed error in spacing factor calculation