Simplified by using boolean/and