update comments and shorten code