Theory section 2 done
Modified code to fit into latex listing