Cleaned up pre code