implemented startpoint marking and layer setup/teardown