works with cin input for integers