added powsum and other small changes