Move everything to one file and add some documentation