Finishing touches to code. Deleted old code