Edited checkSide (Still not working perfectly)