added hop check while loops for bishop and reformatted the code with astyle