performance improved and tested