added basic structure and implemented fits, as_int and trim