Updated and Refined Code

Deleted the old code. Split the definitions into a separate tab.