* cleanup macros * add test cases and fix counting function * add check statements * remove deprecated support for Option * replace some logic * remove debug print