final version

Checked for bugs and everything works!