Various imporevements on task 1.