Update bitcube.py

added cube implementation, condensed it down, and made it better.