added ambient declarations for functions and variables