Working Version after Debug