Principles of elementary algebra with applications