Added type checking and example script