Cleaned code and removed code that is no longer in use.