Modifications for my own purposes.