steal some code from original repository