Added GUI Code and sleep code