Improved timer, added stability check.