added class Scheme and reworked reading functions