Loooooooooong paper with appendix.