lots of fixes and improvements, time limiting completed