Toy implementation of 'a' and 'p'