made my own function
shorter code