adding some reference code, may be useful later