Cleaned up code in spinningBox example