added comments and wrapped the remaining calls in powershell