removed plotting code and all debug comments