Added cubegen functionality