Changed activated function and optimized database tables