Updated to v3 API + added comments