Removed old code and replaced with new code