commited with fully functional code