Updated with autoclose function.
Started implementing the auto-close methods.