implemented testing when flags 1 or 2 are used