improved classes, updated variable structure