removing if statements in favor of guards. fixing warnings.