Cleaned up code with better importing, but still needs editing