made more generic, added comments
setting data shape