Updated Q with basic typings - limited by current TypeScript limitations