Added comments. Cleaned codes.