added functional main