writing core classes