Cleaned up code, before lunch actually, first section, for loop checks out okay