include Ben Almans excellent getObject function