shortened code to not repeat myself