Fix small bug and finalize code!