Finishing code

Final version