speed hack fixed and test added