implemented looking 2 ahead