updated instructions + tidy code