Removed premature optimization to ensure functionality is correct before later optimizing;