mainly made the code shorter: