reduced math to optimize performance