elaborated get() function; made size function more dynamic