unable to make function work, will create new from scratch