Many updated. Read code for details