change if to assert
add custom type mismatch excepion
change type equality to isinstance
check for empty return statement
add tests
empty return check