First proper version, all working with proper comments