final version - everything is working