writing policy code