Made minor fixing, called function