Changed order of constructor to be more logical for error checking