added SIZE, replced some functions