Final code no bugs