Final version, everything is working