refactored code, cleaned up garbage. fixed axis label bug