fixes and adds functions