Added some extra check, might add later corners check aswell.