destroyed code logic to be fix by Ian