working, checked against Agol code