Final experiment code. Now with practice test and bug fixes.