Final code for all labs