speeding up some solutions