Changed setting preThetas into for loop.