Solution with proper references. Hopefully...