Cleaned up LKM code