Q4 complete

Made some small changes to 2 and 3 also. Just optimization and removal
of variables that were not needed.