write head scripts