Lab 4, part 4

Error rendering cube in lab, added error checking function. Appears to
be no issue in main.cpp