made it a function