commented it and made it to a function