fixed dumb problem, improved speed