Addition of a constructor and slight tweaks