First commit with all the working code