Working program, although failing warnings.