changed function name and call it at the end