fixed wrong loops in powerscan. might have caused problems and inefficiences the second loop was inside the first, although that should not have been done that way