all the type checking code... pretty sketch
not done but nap time is here