Solution by Veesh Goldman
