added comments and removed warning