Modified p from method to function in order to reduce unnecessary typing