improved comments
simplified calculation