added is_defined keyword. Done some minor changes
added is_defined keyword. Done some minor changes