reviewed with nimit, changes applied