Done! Final code for 1.0