updated comments and small fixes