Added comments, shockwave and fixed logic