Adding note selection code to layer