Modified fork for my own goals.