fix mypower, update functions, add teststs