Added cube validation logic and poor-man's testing