Prepared code for zaidman's exercises