checks type of arguments
README for typecheck