Cleaned up the code but there are still problems with yAxis