A messed around with source for Calibre, used for school project