Added correct computation of space to be allocated. Added pointer
chasing for classes with fields.