dont beat yourself up too bad.. thats not a bad group for the distance considering its your very first time behind that type of rifle.. and that some of the shots were taken from the standing..
remember that most off the shelf m4orgeries are 3 MOA guns at best.. this means if you do everything perfect.. and are able to run the gun at its absolute max capability.. you are looking at a 3" (or larger) hole at 100 yards.... Ive seen plenty of M4's that can only shoot 4-5 MOA on a good day.. no matter what ammo you feed them...
at closer distances.. something to keep in mind is you have a 2 1/2" variance between POA and POI.. that front sight is tall.. and the weapon is designed for you to be looking almost 3 inches above the center of the bore.... not that 50 yards is CQB shooting.. but if youre trying to take a "surgical" shot at that range or any closer.. its something you need to think about/train for when youre starting out....