first effort at checking that submissions are valid

some code repetition and it probably doesn't actually work, but it's a jumping off point.