working on scoping to make the code prettier