Added ans functionality