generalized the problem functions and types to have better testing built in