Cleaned up a bit setcube function