Removed comments and Made better IsInCheck function