Solutions 1 to 3 updated to Rpubs.