added isinstance function
made object number_types local to each method