clean up unused code and make input smaller