fixed a bug in translate hierarchies to density