Removed the old code and did some small adjustments