added cube function