First commit. Fully functional code