added optics, added unittests