Fixed bug with importing matplotlib on cluster. removed some unused code