added programmatic interface