optimized ship checker

Ship checker was optimized