changed to used cubex helper function