stuff done during wadror course - http://www.cs.helsinki.fi/courses/582368/2014/k/k/1