resolves #17 resolves #18 cleanup on input validation