Cleaned up code and removed faulty lines.