added func to And method, refactored other methods