lot of changes, need to check for errors