Change implementation of setSize function