fixed bugs and added printing markers